/* 
 * File:   DirectoryNode.h
 * Author: KENNJI
 *
 * Created on March 22, 2013, 4:58 PM
 */


#ifndef DIRECTORYNODE_H
#define	DIRECTORYNODE_H

#include "ZipNode.h"
#include "stdlib.h"

/**
 * Class that is a ZipNode
 */
class DirectoryNode : public ZipNode
{
public:

    /**
     * Instantiate a Recursive node
     * @param name The name of current node
     */
    DirectoryNode(const char* name) : ZipNode(name)
    {
	this->branchCounter_ = 0;
	this->currentBranches_ = DEFAULT_SIZE;
	this->branches_ = (ZipNode*) malloc(sizeof (ZipNode) * DEFAULT_SIZE);
    }

    /**
     * Free the allocated memory used to store the branches
     * of current node 
     */
    ~DirectoryNode()
    {
	free(this->branches_);
    }

    /**
     * Check if this node is an instance of DirectoryNode or FileNode
     * @return true if is an instance of FileNode, other case false
     */
    bool isLeaf()const
    {
	return false;
    }

};

#endif	/* DIRECTORYNODE_H */

